<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <title>友情链接</title>
  <link href="{{ asset('/boot/css/bootstrap.min.css') }}" rel="stylesheet">
<!--  -->
</head>
<body>
<center>  
<form action="" method="post" name="myForm">
    {{ csrf_field() }}
    {{ method_field('delete') }}
</form>
   <table class="table table-bordered table-hover" >
   <p class="bg-primary">@if( session('msg') )
              {{ session()->get('msg') }}
              @endif</p>
  
   <h4><p class="bg-info">
    <a href="{{ url('admin/storeLinks') }}">浏览</a>
    /
    <a href="{{ url('admin/storeLinks') }}/create">添加</a>
    </p></h2>


  <form action='/admin/storeLinks' method='get'>
                        <div class='media-body'>
                            连接名称：<input type='text' class='form-control m-b-5' name='linksName'>
                        </div>
                        <input type="submit" value="搜索" class="btn">
                       
                       
                    </form> 
   <thead style="text-align:center;">
      <tr>
       <td><b>Id</b></td>
        <td><b>连接名称</b></td>
        <td><b>连接的URL</b></td>
         <td><b>友情连接开关<b></td>
         <td><b>操作</b></td>
      </tr>
   </thead>
  <tbody>
    @foreach ($list as $v)
    <tr style="text-align:center">
       <td>{{ $v->linksId }}</td>
       <td>{{ $v->linksName }}</td>
       <td>{{ $v->linksUrl }}</td>
       <td>{{ $v->linksSwitch == 0? '开启':'关闭' }}</td>
       <td>
       <a href="javascript:doDel({{ $v->linksId }})">删除</a>/
       <a href="/admin/storeLinks/{{ $v->linksId }}/edit">修改</a>
       </td> 
    </tr>
    @endforeach
   </tbody>
   </table>
 
 {{ $list->appends($where)->links() }}


</body>



 
<script type="text/javascript">
        function doDel(id)
        {
           
            if (confirm('确定要删除吗?')) {
                var form = document.myForm;
                form.action = '/admin/storeLinks/'+id;
                form.submit();
            }
        }
    </script>
</html>
